import 'package:base_flutter/base_flutter.dart';
import 'package:saas_order_meal/net/apis.dart';

import '../net/net_response/site_list_data.dart';

class SiteModel extends BaseMvvmModel{
  @override
  void onCleared() {
    // TODO: implement onCleared
  }

  ///获取场所列表
  Future<List<SiteListData>> getSiteList(dynamic orderModelId) async {
    var map = {
      "orderModelId":orderModelId
    };

    var data = await HttpGo.instance.postData(Apis.placeList,data: map,options: Options(contentType: Headers.formUrlEncodedContentType));
    if("0"==data['code']){
      var list = (data['data'] as List?)??[];
      return list.map((e) => SiteListData.fromJson(e)).toList();
    }else{
      throw data['msg'];
    }
  }

}